package com.bitdf.txing.chat.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bitdf.txing.chat.dao.ReadMessageDao;
import com.bitdf.txing.chat.entity.ReadMessageEntity;
import com.bitdf.txing.chat.service.ReadMessageService;
import com.bitdf.txing.common.utils.PageUtils;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("readMessageService")
public class ReadMessageServiceImpl extends ServiceImpl<ReadMessageDao, ReadMessageEntity> implements ReadMessageService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
//        IPage<ReadMessageEntity> page = this.page(
//                new Query<ReadMessageEntity>().getPage(params),
//                new QueryWrapper<ReadMessageEntity>()
//        );
//
//        return new PageUtils(page);
        return null;
    }

    @Override
    public ReadMessageEntity getReadMessage(Long readUserId, Long send_user_id) {
        ReadMessageEntity entity = this.getOne(new QueryWrapper<ReadMessageEntity>().eq("read_user_id",readUserId).eq("send_user_id", send_user_id));
        return entity;
    }

}